using System;
using System.Collections.Generic;
using System.Text;
using System.Web.Compilation;
using System.Web;
using System.Web.Caching;
using System.IO;

namespace Medianamik.Globalization
{
    public class TranslationResourceProviderFactory : ResourceProviderFactory
    {
        public override IResourceProvider CreateGlobalResourceProvider(string classKey)
        {
            return new TranslationResourceProvider(classKey);
        }

        public override IResourceProvider CreateLocalResourceProvider(string virtualPath)
        {
            String classKey = virtualPath;
            if (!string.IsNullOrEmpty(virtualPath))
            {
                virtualPath = virtualPath.Remove(0, 1);
                classKey = virtualPath.Remove(0, virtualPath.IndexOf('/') + 1);
            }

            return new TranslationResourceProvider(classKey);
        }
    }
}
